import { Controller, Get } from '@nestjs/common';
import { Crud } from 'nestjs-mongoose-crud'
import { Course } from '@libs/db/models/course.model'
import { InjectModel } from 'nestjs-typegoose';
import { ApiTags } from '@nestjs/swagger';

@Crud({
    model:Course
})
//路径
@Controller('courses')
@ApiTags('课程')
export class CoursesController {
    constructor (@InjectModel(Course) private readonly model){}

    @Get('option')
    option(){
        return {
            title:"课程管理",
            searchMenuSpan:8,
            column:[
                { prop:"name",label:"课程名称",row:true,sortable:true,search:true},
                { prop:"cover",label:"课程封面图",type:'upload',listType:'picture-img',row: true,width: 120,action:'upload' }
            ]
        }
    }
}
